package net.zjitc.jdbc;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

/**
 * @Author admin
 * @Date 2019/4/24 8:58
 */
public class test {
    public static void main(String[] args) {
        try {
            Class.forName("com.mysql.jdbc.Driver");
            String url="jdbc:mysql://localhost:3306/hxy";
            String user="root";
            String password="123456";
            Connection conn= DriverManager.getConnection(url,user,password);
            Statement stmt=conn.createStatement();
            String sql="INSERT INTO USER(NAME,age) VALUE('lisi',19)";

            int c=stmt.executeUpdate(sql);
            System.out.println("影响了"+c+"行");

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
